﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LittleLove.Base
{
    public class PresentDB
    {
        public static List<Slide> Slides;
        public static string Title;
        public enum Events : int
        {
            MAR_2012 = 201203,
            APR_2012 = 201204,
            APR_2013 = 201304,
        };

        public static void setFirstEvent()
        {
            Title = "First";
            Slides = new List<Base.Slide>();
            Base.Slide slide = new Base.Slide(Properties.Resources.test2, "Here's my present.");
            Slides.Add(slide);
            slide = new Base.Slide(Properties.Resources.test2, "Hello world.");
            Slides.Add(slide);
            slide = new Base.Slide(Properties.Resources.test2, "Hello world.");
            Slides.Add(slide);
        }

        public static void setSecondEvent()
        {
            Title = "Second";
            Slides = new List<Base.Slide>();
            Base.Slide slide = new Base.Slide(Properties.Resources.test2, "Nothing change my love for you.");
            Slides.Add(slide);
            slide = new Base.Slide(Properties.Resources.test2, "How could this happens to me.");
            Slides.Add(slide);
        }

        public static void setThirdEvent()
        {
            Title = "Third";
            Slides = new List<Base.Slide>();
            Base.Slide slide = new Base.Slide(Properties.Resources.test2, "Wake me up when september ends.");
            Slides.Add(slide);
            slide = new Base.Slide(Properties.Resources.test2, "In God, we trust.");
            Slides.Add(slide);
        }

        public static void setEmptyEvent()
        {
            Title = "";
            Slides = new List<Base.Slide>();
        }

        public static List<Slide> getEvent(Events _event)
        {
            switch (_event)
            {
                case Events.MAR_2012:
                    setFirstEvent();
                    break;
                case Events.APR_2012:
                    setSecondEvent();
                    break;
                case Events.APR_2013:
                    setThirdEvent();
                    break;
                default:
                    setEmptyEvent();
                    break;
            }
            return Slides;
        }

        public static void clearSlidesMemory()
        {
            if (Slides != null)
            {
                Slides.Clear();
            }
        }
    }
}
